<template>
  <div>
    <table border="1" width="800">
      <tr>
        <th v-for="(item, key, index) in column" :key="key">{{ item }}</th>
      </tr>
      <tr v-for="(item, index) in data">
        <!-- <td>{{ index + 1 }}</td>
        <td>{{ item.name }}</td>
        <td>{{ item.age }}</td> -->
        <td v-for="(val, key, index) in item" :key="index">{{ val }}</td>
        <td>
          <slot name="action" :row="item">
            <button>修改</button>
            <button>删除</button>
          </slot>
        </td>
      </tr>
    </table>
  </div>
</template>

<script>
export default {
  props: {
    data: {
      type: Array,
      // 自定义必填写选项
      required: true
    },
    column: {
      type: Object,
      required: true
    }
  }
}
</script>

<style lang="scss" scoped></style>
